import { BasicColumn, FormSchema } from '@apps/antd-admin/src/components/Table';

export const columns: BasicColumn[] = [
  {
    title: '类别名称',
    dataIndex: 'vipcardCategoryName',
    width: 200,
  },
  {
    title: '排序',
    dataIndex: 'sort',
    width: 200,
  },
  {
    title: '创建时间',
    dataIndex: 'createTime',
    width: 200,
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'vipcardCategoryName',
    label: '类别名称',
    component: 'Input',
    colProps: { span: 8 },
  },
];

export const formSchema: FormSchema[] = [
  {
    label: '类别Id',
    field: 'vipcardCategoryId',
    component: 'Input',
    required: false,
    show: false,
  },
  {
    label: '类别名称',
    field: 'vipcardCategoryName',
    component: 'Input',
    required: true,
  },
  {
    label: '类别编码',
    field: 'vipcardCategoryCode',
    component: 'Input',
    required: true,
    dynamicDisabled: ({ model }) => {
      if (model.vipcardCategoryId) {
        return true;
      } else {
        return false;
      }
    },
  },
  {
    label: '排序',
    field: 'sort',
    component: 'InputNumber',
    required: true,
  },
];
